package net.taviscaron.drivenotes.server.service.endpoint;

import javax.jws.WebMethod;
import javax.jws.WebService;
import net.taviscaron.drivenotes.shared.model.entity.User;
import net.taviscaron.drivenotes.shared.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * LoginService JAX-WS endpoint
 * @author Andrei Senchuk
 * @author Alex Zhegzdrin
 */
@WebService(serviceName="LoginService")
public class LoginServiceEndpoint implements LoginService {
    @Autowired
    public LoginService loginService;

    @WebMethod
    public User findUserByCredentials(String username, String password) {
        return loginService.findUserByCredentials(username, password);
    }

    @WebMethod
    public User findById(Long userId) {
        return loginService.findById(userId);
    }
}
